package com.zys.el.time.controller;


import com.zys.el.time.entity.AbsorbedDeal;
import com.zys.el.time.service.IAbsorbedDealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/absorbed_deal")
public class AbsorbedDealController {
    @Autowired
    private IAbsorbedDealService absorbedDealService;


    @GetMapping("/{deal_id}")
    public List<AbsorbedDeal> getAbDealByDealId(@PathVariable("deal_id") String dealId) {
        return absorbedDealService.getAbDealByDealId(dealId);
    }

    @GetMapping("/user/{user_id}")
    public List<AbsorbedDeal> getAbDealByUserId(@PathVariable("user_id") String userId) {
        return absorbedDealService.getAbDealByUserId(userId);
    }
}
